<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: products_filters.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright © since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	© 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	© 2002-2003 osCommerce - www.oscommerce.com
* 	© 2003     nextcommerce - www.nextcommerce.org
* 	© 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

if(!empty($pInfo->products_id)) { ?>
<table width="100%">
	<tr>
		<td width="70%">
			Der Filtername sollte keine Sonderzeichen und in einem einheitlichem Format hinterlegt werden.<br />
			zum Beispiel: <i>blau, rot oder Hose, Jacke oder XL</i>
		</td>
		<td>
			<div id="parent_filter_drop" style="display:none;padding-left:20px"></div>
			<?php echo get_help(9, 'Filter Struktur'); ?> <input autocomplete="off" type="text" name="new_filter" value="" id="new_filter" onkeydown="if(event.keyCode=='13') xajax_saveNewFilter($('#new_filter').val(),$('#parent_name').val(),<?php echo $pInfo->products_id; ?>)" /> <button class="button" onclick="xajax_saveNewFilter($('#new_filter').val(),$('#parent_name').val(),<?php echo $pInfo->products_id; ?>); return false;"><span class="button_disk-black">Anlegen</span></button>
		</td>
	</tr>
</table><br />

<div id="filter_ul"></div>
<div id="category_form" title="Kategorieauswahl" style="max-height:390px;overflow:auto"></div>
<link href="includes/javascript/check_tree/jquery.checkboxtree.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="includes/javascript/check_tree/jquery.checkboxtree.min.js"></script>
<script type="text/javascript">
	function openCategoryForm() {
		$('.cat_tree').checkboxTree({
			initializeChecked: 'expanded', 
			initializeUnchecked: 'collapsed',
			collapseUiIcon: 'ui-icon-plus', 
			expandUiIcon:'ui-icon-minus',
			onCheck:{node:'expand'},
			onUncheck:{node:'collapse'}
	    });
		$("#category_form").dialog({autoOpen:false,show:'fade',height:'auto',width:320,modal:true});
		setTimeout("$('#category_form').dialog('open')", 250);
	}
	function closeCategoryForm() {
		$("#category_form").dialog('close');
	}
	$('.click_all').live('click', function(){
    	if($(this).is(':checked')) {
    		$('.cat_tree :input').each(function(){
    			$(this).attr('checked', false).attr('disabled', true);
    		});
    		$('.cat_tree').css('opacity','0.3');
    	} else {
    		$('.cat_tree :input').each(function(){
    			$(this).removeAttr('disabled');
    		});
    		$('.cat_tree').css('opacity','1');
    	}
    });
	$('.filter_input').live('click', function(){
		var id = $(this).attr('id');
		var parent = $(this).val();
		if($(this).is(':checked'))
			xajax_saveFilter(id,1,<?php echo $pInfo->products_id; ?>,parent);
		else
			xajax_saveFilter(id,0,<?php echo $pInfo->products_id; ?>,parent);
	});
</script>
<?php } else { ?>
Da für dieses Produkt noch keine ID verfügbar ist, kann der Filter erst nach dem ersten Speichern genutzt werden.
<?php } ?>